package com.isp.org.server.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.isp.common.model.vo.Result;
import com.isp.org.api.dto.Resource;
import com.isp.org.api.dto.menu.SysMenu;
import com.isp.org.api.dto.user.SysUserId;
import com.isp.org.server.domain.entity.MenuEntity;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Set;

/**
 * @author linsy
 * @version 1.0
 * @created 2024/3/12 16:48
 */
@Mapper
public interface MenuMapper extends BaseMapper<MenuEntity> {

    List<SysMenu> findMenusByType(String app, Integer type);

    List<SysMenu> findByUserId(String app, Long userId, Integer type, Boolean present);

    SysMenu findByCode(String app, String code);

    SysMenu findByUrlAndMethod(String app, String url, String urlMethod);

    List<SysUserId> findUserByMenuUrl(String url, String urlMethod);

    Set<Resource> findAllByType(Integer type);

    Set<Resource> queryInRoleIdAndType(Set<Long> roleIds, Integer menuType);
}
